package source.events;

/**
 * The abstract class event is the base for all possible event types in the system.
 * To make a new event, you simply extend the event class and add whatever public
 * attributes are required to make the event meaningful. 
 * 
 * Events are intended to be used as messages to alert listeners when a class has
 * Changed its state, and therefore other changes might need to take place.
 * They are also intended to be Plain Old Data, and not contain any behavior of
 * thier own.
 * 
 * While it is possible to retain a refrence to an event once fired, this is
 * discouraged - events are not meant as a method of two way communication
 * both because of their (possibly) asynchronous nature and because the object
 * that fires the event (intentionally) has no way of knowing what object(s) 
 * are listening for that event.
 * 
 * @author Brent
 *
 */

public abstract class Event {
	/**
	 * A required string that represents the type of the event.  This will usually
	 * give the listeners some hint as to what the event means, and is used for 
	 * event logging.
	 */
	public String type;
	
	/**
	 * If true, it signifies that all listeners responded to the event sucessfully.
	 * If false, it signifes that at least one listener failed to respond to the
	 * event.
	 */
	public boolean handled;
	
	/**
	 * A string that describes the event. Intended to be used for event logging and
	 * debugging.
	 */
	public abstract String toString();
}
